package customer.design.dispatcher.dispatchermode.real.strategy;

import customer.design.dispatcher.dispatchermode.bean.SystemBean;
import customer.design.dispatcher.dispatchermode.real.annotation.Business;
import customer.design.dispatcher.dispatchermode.real.biz.AbstractBiz;
import customer.design.dispatcher.dispatchermode.real.busenum.BusinessTypeEnum;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author ldanniel
 */
@Component
@Business(BusinessTypeEnum.SYS_MSG_002)
public class SysProcessStrategy  extends AbstractBiz<SystemBean> {


    @Override
    public SystemBean buildBean(Map<String, Object> paramMap) {
        SystemBean systemBean = new SystemBean();
        try {
            BeanUtils.copyProperties(systemBean,paramMap);
        } catch (Exception e) {
            System.out.println("注入属性失败");
        }
        return systemBean;
    }

    @Override
    public Object callBiz(SystemBean systemBean) {
        System.out.println("执行SysProcessStrategy的callBi方法");
        return "执行SysProcessStrategy的callBi方法";
    }
}